package com.jidong.test_springboot.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;

@Data
public class UserWithDept {
	private int id;
	private String name;
	private String gender;
	private int age;
	private String deptName;
	private String sex;
	private int deptId;
	private String avatar;
	// 这句话的意思是自动把数据库来的日期类型自动转为字符串类型
	@JsonFormat(pattern="MM/dd/yyyy",timezone="GMT+8")
	private Date birthday;
	private boolean editable;
	
	
	/*自己设定getSex方法**/
	public String getSex() {
		if("1".equals(gender)) {
			this.sex="男";
		}else {
			this.sex="女";
		}
		return this.sex;
	}
	
	
	
	
	
	
	
	
	
	
}
